<template>
	<view class="uni-padding-wrap uni-common-mt">
		<navigator  url="../info/companyInfo">
				<view class="Contact">联系我们>></view>
		</navigator>
		<view class="index">
		</view>
		<view class="" style="text-align: center;margin: 50px auto;color: #999999;">
			<image src="../../static/lxr2.png" mode="" style="height: 120px;width: 120px;"></image>
		</view>
		<view class="" v-if="ifcompany === true" >
			<navigator url="../manager/stat/stat">
				<button type="primary" :disabled="empowerDisabled" style="background: #195B40;border-radius: 25px;width: 247px;height: 50px;font-weight: 550;margin: 10px auto;">查看登记码</button>
			</navigator>
		</view>
		<view v-if="ifcompany === false">
			<navigator  url="../user/reg/reg">
				<button type="primary" :disabled="empowerDisabled" style="backgroutruend: #195B40;border-radius: 25px;width: 247px;height: 50px;font-weight: 550;margin: 10px auto;">注册公司码</button>
			</navigator>
		</view>
		<view v-if="ifcompany === true">
			<navigator  url="../manager/enterprise/enterprise">
				<button type="primary" style="backgroutruend: #195B40;border-radius: 25px;width: 247px;height: 50px;font-weight: 550;margin: 10px auto;">查看登记信息</button>
			</navigator>
		</view>
		<view>
			<p style='color: #999999;margin: 0 20px;'>小程序为注册公司二维码,收集员工信息和每日温度,需要您的授权.</p>
		</view>
		<view class="" style="text-align: center;margin-top: 20%;color: #999999;">
			@ 吉鼎(厦门)科技有限公司 提供技术支持
		</view>
		<!-- <hvl-contact title="吉鼎客服" /> -->
	</view>
</template>

<script>
	import hvlContact from '../../components/hvl-contact.vue'
	export default {
		components: {
			hvlContact
		},
		data() {
			return {
				empowerDisabled:true,
				ifcompany:false,
				webviewStyles: {
					progress: {
						color: '#FF3333'
					}
				}
			}
		},
		methods: {
			open:function() {
				plus.runtime.openURL(this.url, function(res) {  
					console.log(res);  
				});  
			},
			onShareAppMessage: function (ops) {
			   return {
			     title: '信息登记，体温填报。',
			     path: '/pages/index/index', //这里设定都是以"/page"开头,并拼接好传递的参数
				 imageUrl: '/static/share.png',
			     success: function (res) {
			       // 转发成功
			       console.log(res);
			       console.log("转发成功:" + JSON.stringify(res));
			     },
			     fail: function (res) {
			       // 转发失败
			       console.log("转发失败:" + JSON.stringify(res));
			     }
			   }
			 },
		},
		onShow: function() {
			var that = this;
			  // 查看是否授权
			  wx.getSetting({
			   success: function (res) {
			    if (res.authSetting['scope.userInfo']) {
				that.empowerDisabled =false
				if(wx.getStorageSync('SysId')!=''){
					that.ifcompany=true
				}
			    }else{
			}
			   },
			  }),
			this.companyDisabled = true;
		},
		mounted() {
			if(wx.getStorageSync('SysId')!=''){
				this.ifcompany=true
			}
		}
	}
</script>

<style>
.action-row {
		display: flex;
		flex-direction: row;
		justify-content: center;
		margin-bottom: 10px;
	}

	.action-row navigator {
		color: #007aff;
		padding: 0 10px;
	}
	.index{
		background: rgb(50,123,248);
		height: 230;
		width: 100%;
	}
	page{
		height: unset;
	}
	.tips {
	    display: flex;
	    justify-content: center;
	    align-items: center;
	    position: fixed;
	    left: 0;
	    top: 0;
	    z-index: 100;
	    width: 100%;
	    height: 100%;
	    background: rgba(0,0,0,0.7);
	}
	
	.tips .tips_box {
	    display: flex;
	    flex-direction: column;
	    align-items: center;
	    width: 75%;
	    height: auto;
	    border-radius: 45rpx;
	    background: #fff;
	    overflow: hidden;
	}
	
	.tips .tips_box .hint_view {
	    display: flex;
	    align-items: center;
	}
	
	.tips .tips_box .hint_view .text {
	    display: flex;
	    flex-direction: column;
	    margin: 12rpx 24rpx;
	}
	
	.tips .tips_box .hint1 {
	    margin-top: 38rpx;
	    text-align: center;
	    font-size: 30rpx;
	    color: #1a1a1a;
	    line-height:52rpx;
	    border-bottom:1px solid;
	}
	
	.agreeBtn {
	    display: flex;
	    justify-content: center;
	    align-items: center;
	    margin: 32rpx 0 32px;
	    width: 70%;
	    line-height: 64rpx;
	    border-radius: 80rpx;
	    font-size: 32rpx;
	    letter-spacing: 6rpx;
	    color: #fff;
	}
	.isTipShow {
	  display: block;
	}
	
	.isTipHide {
	  display: none;
	}
	.Contact{
		text-align: right;
		color: #1AAD19;
	}
</style>
